class DeclinedInvitationRequestsController < ApplicationController
	include InvitationRequestsAcceptanceHelper

	before_filter :authorize_admin

	def new
		get_invitation_request
	end
	
	def create
		get_invitation_request
		
		reason = params[:invitation_request][:status_reason]
		@invitation_request.change_status :declined, reason 
		@invitation_request.save!
		Mailer.deliver_invitation_request_declined(@invitation_request)
		
		flash[:notice] = "Invitation request for #{@invitation_request.person.name} has been declined"		
		redirect_to invitation_requests_path
	end
end
